package com.iven.xie.designpattern.factory.abstractfactory;

/**
 * @author iven.xie
 */
public class Computer {

    private CPU cpu;

    private MainBoard mainBoard;

    private HardDisk hardDisk;

    public Computer(CPU cpu, MainBoard mainBoard, HardDisk hardDisk) {
        this.cpu = cpu;
        this.mainBoard = mainBoard;
        this.hardDisk = hardDisk;
    }

    public void generate() {
        System.out.println("开始组装电脑");
        this.cpu.create();
        this.mainBoard.create();
        this.hardDisk.create();
        System.out.println("结束组装电脑");
    }
}
